package com.example.question.array;

import java.util.ArrayList;
import java.util.List;

public class Code02_448 {

    public List<Integer> findDisappearedNumbers(int[] nums) {
        List<Integer> result = new ArrayList<>();
        int[] countMap = new int[nums.length];

        for (int num : nums) {
            int index = num - 1;
            countMap[index]++;
        }

        for (int index = 0; index < countMap.length; index++) {
            if (countMap[index] == 0) {
                result.add(index + 1);
            }
        }
        return result;
    }
}
